﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using BL.Membership;

namespace OrderDesk.Controllers
{
    public class HomeController : BaseController
    {
        //
        // GET: /Home/

        public ActionResult Index()
        {
            if (CurrentUser.Permissions == UserPermission.None)
                return RedirectToAction("index", "Home", new { Area = "" });
            else if (CurrentUser.Permissions == UserPermission.OrdersStation)
                return RedirectToAction("index", "Orders", new { Area = "OrdersStation" });
            else if (CurrentUser.Permissions == UserPermission.EmployeesOrdersManagement)
                return RedirectToAction("index", "Orders", new { Area = "OrdersManagment" });
            else
                return RedirectToAction("index", "Home", new { Area = "Admin" });
        }
    }
}
